{#
 This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0. If a copy of the MPL was not distributed with this
 file, You can obtain one at https://mozilla.org/MPL/2.0/.
#}

{% extends "firefox/base/base-protocol.html" %}

{% block page_title %}Mozilla Firefox Release Notes{% endblock %}
{% block page_desc %}Release notes for each version of Firefox.{% endblock %}
{% block body_id %}firefox-releases-index{% endblock %}

{% block page_css %}
  {{ css_bundle('firefox_releases_index') }}

  {% if switch('release-notes-newsletter-banner', ['en']) %}
    {{ css_bundle('firefox-newsletter-banner') }}
  {% endif %}
{% endblock %}

{% block body_class %}{{ super() }} mzp-t-firefox{% endblock %}

{# We want to denote www.firefox.com as the canonical source of releases #}
{% block canonical_urls %}
    {{ firefox_com_canonical_tag(dest_path="/en-US/releases/") }}
{% endblock %}

{% block content %}
  <main id="main-content" class="mzp-l-content">
    <a href="https://www.firefox.com/">
      <span class="mzp-c-wordmark mzp-t-wordmark-md mzp-t-product-firefox">Firefox</span>
    </a>
    <h1>Firefox Releases</h1>
    <p>Firefox release notes are specific to each version of the application. Select your version from the list below to see the release notes for it.</p>
    <ol reversed class="c-release-list">
      {% for int_version, versions in releases -%}
      <li>
        <strong>{{ get_link(int_version, versions.major) }}</strong>
        {% if versions.minor -%}
        <ol>
          {% for version in versions.minor -%}
          <li>{{ get_link(int_version, version) }}</li>
          {% endfor -%}
        </ol>
        {% endif -%}
      </li>
      {% endfor -%}
      <li>
        <strong><a href="0.1.html">0.1</a></strong>
        <ol>
          <li><a href="0.2.html">0.2</a></li>
          <li><a href="0.3.html">0.3</a></li>
          <li><a href="0.4.html">0.4</a></li>
          <li><a href="0.5.html">0.5</a></li>
          <li><a href="0.6.html">0.6</a></li>
          <li><a href="0.6.1.html">0.6.1</a></li>
          <li><a href="0.7.html">0.7</a></li>
          <li><a href="0.7.1.html">0.7.1</a></li>
          <li><a href="0.8.html">0.8</a></li>
          <li><a href="0.9.html">0.9</a></li>
          <li><a href="0.9.1.html">0.9.1/0.9.2</a></li>
          <li><a href="0.9.3.html">0.9.3</a></li>
          <li><a href="0.10.html">1.0 Preview Release</a></li>
        </ol>
      </li>
    </ol>
  </main>

  {% if switch('release-notes-newsletter-banner', ['en']) %}
    {# Give newsletter landmark a separate aria identifier to the pencil banner: https://github.com/mozilla/bedrock/issues/15958 #}
    {% with aria_label = 'Newsletter' %}
      {% include 'includes/banners/firefox-newsletter.html' %}
    {% endwith %}
  {% endif %}
{% endblock %}

{% macro get_link(int_version, version) %}
  {%- if int_version < 2 -%}
    <a href="{{ version }}.html">{{ version }}</a>
  {%- else -%}
    <a href="../{{ version }}/releasenotes/">{{ version }}</a>
  {%- endif -%}
{% endmacro %}

{% block js %}
  {% if switch('release-notes-newsletter-banner', ['en']) %}
    {{ js_bundle('firefox-newsletter-banner') }}
  {% endif %}
{% endblock %}
